
#pragma once

#include  "qwindow.h"

namespace micro{
namespace gui{


class QStatusBar :	public QWindow
{

public:
	QStatusBar(void);
	~QStatusBar(void);

  bool Create(QWindow* parent)
  {
	DWORD dwStyle = WS_CHILD |WS_VISIBLE;

	CreateBaseWindow( STATUSCLASSNAME , _T(""), dwStyle, 
	QRect(0,0,0,0), 
	parent);
 
	return (_window!=nullptr);
  }
  
  bool SetParts(int numParts, const int *edgePostions)
    { return toBool((BOOL)SendMessage(SB_SETPARTS, numParts, (LPARAM)edgePostions)); }
  bool SetText(LPCTSTR text)
    { return QWindow::SetText(text); }

  void SetPartText(int iPart, QString str, UINT Style=0);
  void SetPartWidth(int iPart, int iWidth) ;


  bool SetText(int index, LPCTSTR text, UINT type)
    { return toBool((BOOL)SendMessage(SB_SETTEXT, index | type, (LPARAM)text)); }
  bool SetText(int index, LPCTSTR text)
    { return SetText(index, text, 0); }
  void Simple(bool simple)
    { SendMessage(SB_SIMPLE, toBOOL(simple), 0); }

   
};


}
}//micro